from PyQt5.QtWidgets import QWidget
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPainter, QColor, QPaintEvent
from core.themecolor import ThemeColor

class FloatWidget(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)

        # Set window flags to make it stay on top
        self.setWindowFlags(Qt.WindowStaysOnTopHint)
        self.setAttribute(Qt.WA_AlwaysStackOnTop)

    def paintEvent(self, event: QPaintEvent):
        painter = QPainter(self)
        color = ThemeColor.baseColor()  # Assuming ThemeColor is available
        color.setAlphaF(0.6)
        painter.fillRect(event.rect(), color)